package com.hubu.parking.entity.park;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户车位预约记录表
 * @TableName parking_reservation
 */
@TableName(value ="parking_reservation")
@Data
public class ParkingReservation implements Serializable {
    /**
     * 预约记录唯一标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 关联用户ID（user.user_id）
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 关联车位ID（parking_spot.spot_id）
     */
    @TableField(value = "spot_id")
    private Integer spotId;

    /**
     * 预约时间
     */
    @TableField(value = "reservation_time")
    private Date reservationTime;

    /**
     * 预约释放时间
     */
    @TableField(value = "end_time")
    private Date endTime;

    /**
     * 创建时间
     */
    @TableField(value = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    /**
     * 是否签到
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * spotNumber
     */
    @TableField(exist = false)
    private String spotNumber;

    /**
     * 最后更新时间
     */
    @TableField(value = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}